vlwkaos' digital garden

GraphQL - Query 실습 답안

쿼리

query poke($limit: Int, $monsters: [String!], $withAccuracy: Boolean!) {
  pokemon_v2_pokemon(where: {name: {_in: $monsters}, pokemon_v2_pokemonmoves: {}}) {
    ...pokemon_v2_pokemonFragment
  }
}

fragment pokemon_v2_pokemonFragment on pokemon_v2_pokemon {
  name
  weight
  height
  pokemon_v2_pokemonmoves(limit: $limit){
    pokemon_v2_move {
      name,
    },
    pokemon_v2_move @include(if: $withAccuracy) {
      accuracy
    }
    
  }
 
}

변수

{
  "limit": 5,
  "monsters": ["pikachu", "charmander", "squirtle"],
  "withAccuracy": true
}
GraphQL - Query 실습 답안